package org.coding.springbootdemocommandline.fileopr.data;

import org.coding.springbootdemocommandline.fileopr.entity.*;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * ^ enjoy coding and be bugfree boy
 *
 * @author guoxh
 * @date 2020/11/7 3:27 下午
 * @desc
 **/
@Component
public class MockData {

    public BillInfo billInfo(){
        BillInfo billInfo = new BillInfo();
        billInfo.setId(1L);
        billInfo.setEntity("津贴管理");
        billInfo.setFileName("津贴管理.xlsx");
        return billInfo;
    }

    public SheetInfo sheetInfo(){
        SheetInfo sheetInfo = new SheetInfo();
        sheetInfo.setId(1L);
        sheetInfo.setBillId(1L);
        sheetInfo.setSheetName("津贴管理sheet0");
        sheetInfo.setSheetOrder(1);
        sheetInfo.setHeaderStartColumn(1);
        sheetInfo.setHeaderEndColumn(5);

        sheetInfo.setDataStartRow(5);
        return sheetInfo;
    }

    public List<SheetHeaderInfo> sheetHeaderInfo(){
        SheetHeaderInfo sheetHeaderInfo1 = new SheetHeaderInfo();
        sheetHeaderInfo1.setId(1L);
        sheetHeaderInfo1.setBillId(1L);
        sheetHeaderInfo1.setSheetId(1L);

        sheetHeaderInfo1.setHeaderValue("津贴管理表头");
        sheetHeaderInfo1.setHeaderStartColumn(1);
        sheetHeaderInfo1.setHeaderEndColumn(4);

        sheetHeaderInfo1.setHeaderStartRow(1);
        sheetHeaderInfo1.setHeaderEndRow(2);


        SheetHeaderInfo sheetHeaderInfo2 = new SheetHeaderInfo();
        sheetHeaderInfo2.setId(1L);
        sheetHeaderInfo2.setBillId(1L);
        sheetHeaderInfo2.setSheetId(1L);

        sheetHeaderInfo2.setHeaderValue("津贴管理表头2");
        sheetHeaderInfo2.setHeaderStartColumn(1);
        sheetHeaderInfo2.setHeaderEndColumn(4);

        sheetHeaderInfo2.setHeaderStartRow(3);
        sheetHeaderInfo2.setHeaderEndRow(3);

        return Arrays.asList(sheetHeaderInfo1,sheetHeaderInfo2);
    }

    public SheetDataInfo sheetDataInfo(){
        SheetDataInfo sheetDataInfo = new SheetDataInfo();
        sheetDataInfo.setId(1L);
        sheetDataInfo.setBillId(1L);
        sheetDataInfo.setSheetId(1L);


        return sheetDataInfo;
    }

    public List<BizData> multiData(int size){
        List<BizData> list = new ArrayList<>(size);
        for(int i=0;i<size;i++){
           BizData bizData = new BizData("code"+i,"name"+i,"remark"+i,"dataA"+i,"dataB"+i);
            list.add(bizData);
        }
        return list;
    }
}
